package com.geekhalo.domainevent.v3.listener;

import com.geekhalo.domainevent.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;

@Service
public class CartListener {
    @Autowired
    private CartService cartService;

    @EventListener
    public void cleanCart(OrderCreatedEvent event){
        CleanCartCommand cleanCartCommand = buildCleanCartCommand...
        this.cartService.clean(cleanCartCommand);
    }
}
